package cn.cs.mapper;

import cn.cs.pojo.CsPerson;
import cn.cs.pojo.CsRoleUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CsPersonMapper {

    public CsPerson getCsPersonById(@Param(value = "id") String id) throws Exception;

    /**
     * 获取员工信息 （保护用户角色）
     * @param id
     * @return
     * @throws Exception
     */
    public CsPerson getPersonById(@Param(value = "id") String id) throws Exception;

    public List<CsPerson> getCsPersonListByMap(Map<String, Object> param) throws Exception;

    public Integer getCsPersonCountByMap(Map<String, Object> param) throws Exception;

    public Integer insertCsPerson(CsPerson csPerson) throws Exception;

    public Integer updateCsPerson(CsPerson csPerson) throws Exception;

    public Integer deleteCsPersonById(@Param(value = "id") String id) throws Exception;

    public CsPerson findPersonByName(@Param(value = "username") String username);

    public Integer insertPerSonRoleBatch(@Param(value = "list") List<CsRoleUser> list, @Param(value = "personId") String personId);

}
